<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    
    <title>登录</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<meta http-equiv="content-type" content="text/html;charset=utf-8">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
	<script type="text/javascript" src="../../js/jquery-3.3.1.js"></script>
	
  </head>
  
  <body>
  <script type="text/javascript">
/*   	  $('#ff').form({
        success:function(data){
            alert(data);
        }
    }); */
    $(document).ready(function(){ 
    	$("#s").click(function(){
    		$.post("${pageContext.request.contextPath}/admin/login",
			{
				ausername : $("#ausername").val(),
				apassword : $("#apassword").val()
			},
			function(data){
				if(data.code == 1){
					window.parent.location.href="../../adminjsps/main.jsp";
				}else{
				alert(data.message);
					$("#msg").html(data.message);
					$("#ausername").html(data.data.ausername);
					$("#apassword").html(data.data.apassword);
				}
			});
    	});
    });
  </script>
     <div style="padding:3px 2px;border-bottom:1px solid #ccc">管理员登录</div>
     <p id="msg" style="color: red; font-weight: 900"></p>
    <form id="ff">
        <table>
            <tr>
                <td>用户名:</td>
                <td><input id="ausername" type="text"></input></td>
            </tr>
            <tr>
                <td>密&emsp;码:</td>
                <td><input id="apassword" type="text"></input></td>
            </tr>
            <tr>
                <td><button id="s" type='button'>提交</button></td>
                <td></td>
            </tr>
        </table>
    </form>
  </body>
</html>
